A Brazilian e-commerce marketplace wants to understand which sellers and categories drive revenue, and whether delivery performance is costing them customer satisfaction and repeat business.
Olist is a Brazilian e-commerce marketplace connecting small sellers to major retail channels. Leadership needs data-driven answers to two strategic questions: Where is revenue concentrated, and are operational failures (late deliveries) eroding the customer relationships that drive repeat business?
The dataset is a real-world e-commerce database from Olist, containing multiple relational tables covering orders, products, customers, sellers, payments, order items, and reviews. All analysis was conducted in PostgreSQL 17 with pgAdmin 4.
Sample query — top sellers by revenue with market share:
-- Top 10 sellers by revenue with cumulative market share WITH seller_revenue AS ( SELECT oi.seller_id, SUM(oi.price) AS total_revenue, COUNT(DISTINCT oi.order_id) AS total_orders FROM order_items oi JOIN orders o ON oi.order_id = o.order_id WHERE o.order_status = 'delivered' GROUP BY oi.seller_id ) SELECT seller_id, total_revenue, total_orders, DENSE_RANK() OVER (ORDER BY total_revenue DESC) AS revenue_rank, ROUND( total_revenue * 100.0 / SUM(total_revenue) OVER(), 2 ) AS market_share_pct FROM seller_revenue ORDER BY revenue_rank LIMIT 10;